﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////


#pragma once
#include "GcmpModel.h"

namespace gcmp
{
    /// \brief 命令授权过滤器
    class GCMP_MODEL_EXPORT ICommandAuthorizationFilter
    {
    public:
        /// \brief 获取全局命令授权过滤器
        /// \return 返回全局命令授权过滤器
        static const ICommandAuthorizationFilter* GetCommandAuthorizationFilter();

        /// \brief 设置全局命令授权过滤器
        /// \param pCommandAuthorizationFilter 命令授权过滤器
        static void SetCommandAuthorizationFilter(OwnerPtr<ICommandAuthorizationFilter> pCommandAuthorizationFilter);

        /// \brief 虚拟析构函数
        virtual ~ICommandAuthorizationFilter() {};

        /// \brief 命令是否授权使用
        /// \param strCommandId 命令Id
        /// \return bool 返回true命令可以使用，否则返回false
        virtual bool IsCommandAutorized(const std::wstring& strCommandId) const = 0;
    };

}



